@inherits BulmaComponentBase
@namespace BulmaRazor.Components

<li @attributes="Attributes" class="@classes">
    @ChildContent
</li>

@code {


    string classes => CssBuilder.Default("steps-segment")
        .AddClassFromAttributes(Attributes)
        .AddClass("is-active", IsActive)
        .AddClass("is-dashed", IsDashed)
        .AddClass("has-gaps", HasGaps)
        .Build();

    /// <summary>
    /// 子内容
    /// </summary>
    [Parameter]
    public RenderFragment ChildContent { get; set; }

    /// <summary>
    /// 激活
    /// </summary>
    
    internal bool IsActive { get; set; }

    /// <summary>
    /// 虚线样式
    /// </summary>
    [Parameter]
    public bool IsDashed { get; set; }

    /// <summary>
    /// 有间隙
    /// </summary>
    [Parameter]
    public bool HasGaps { get; set; }
    
    
    [CascadingParameter]
    private Steps Parent { get; set; }


    
    /// <summary>
    /// 初始化
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();
        Parent?.AddSegment(this);
    }

}